-
Notifications
You must be signed in to change notification settings - Fork 873
Improve AWS Query compatible error handling in unmarshallers #4253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve AWS Query compatible error handling in unmarshallers #4253
Conversation
peterrsongg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified it works in a console app myself. approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors AWS Query compatible error handling in unmarshallers to improve code organization and eliminate duplication. The key change moves error code/type extraction from the AWS Query compatible header to occur earlier in the unmarshalling process and directly updates the errorResponse object, which allows removal of redundant AWS Query compatible checks from individual exception unmarshallers.
- Consolidated AWS Query compatible error code/type extraction to occur once per response instead of per exception
- Eliminated duplicate AWS Query compatible logic from individual exception unmarshallers
- Introduced
errorTypeNamevariable to preserve the original error code for exception matching before AWS Query header override
Reviewed changes
Copilot reviewed 7 out of 117 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.tt | Updated AWS Query compatible block to directly modify errorResponse.Code and errorResponse.Type |
| generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCResponseUnmarshaller.tt | Moved AWS Query compatible block before exception matching and introduced errorTypeName variable |
| generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCExceptionUnmarshaller.tt | Removed duplicate AWS Query compatible logic from exception unmarshallers |
| sdk/src/Services/SQS/Generated/Model/Internal/MarshallTransformations/* | Applied template changes to all SQS response unmarshallers |
| sdk/src/Services/CloudWatch/Generated/Model/Internal/MarshallTransformations/* | Applied template changes to all CloudWatch response unmarshallers |
| sdk/test/Services/QueryCompatible*/Generated/Model/Internal/MarshallTransformations/* | Applied template changes to test service unmarshallers |
| generator/.DevConfigs/78714232-60db-41f4-8696-7764cc7bd5c9.json | Added dev config with patch version bump for SQS and CloudWatch |
c472345
into
aws-sdk-net-v3.7-development
Description
Modified error response unmarshalling to directly update errorResponse object instead of using intermediate variables. For AWS Query compatible services, error codes are now extracted and set on the errorResponse object within the generate AWSQueryCompatibleBlock, this allowed us to remove conditional AWS Query compatible checks in
JsonRPCExceptionUnmarshallersince theerrorResponsealready contains the proper code and type.Motivation and Context
DOTNET-8439Testing
DRY_RUN-71a1a982-8709-48d3-a99a-c6d4c5251dd8Screenshots (if appropriate)
Types of changes
Checklist
License